import type { AxiosRequestConfig } from 'axios';
import type { ClassifyWallList } from './classify';
import { request } from '@/utils/request';

export interface DownloadWall {
  id: string;
}
export interface UserInfo {
  IP: string;
  address: { country: string; province: string; city: string };
  downloadSize: number;
  scoreSize: number;
}

export const apiDownloadWall = (data: { classid: string; wallId: string }, config?: Omit<AxiosRequestConfig, 'data'>) => {
  return request<DownloadWall>('/downloadWall', {
    data,
    ...config,
  });
};

export const apiUserInfo = () => {
  return request<UserInfo>('/userInfo');
};

export const apiUserWallList = (
  data: {
    type?: 'score' | 'download';
    pageSize?: number;
    pageNum?: number;
  } = {}
) => {
  return request<ClassifyWallList[]>('/userWallList', {
    data,
  });
};
